package map;

import com.jme.math.Vector3f;
import com.jme.renderer.Camera;

public class SpectatorPoint {
	
	protected Vector3f location;
	
	public SpectatorPoint(String loc) {
		location = createVector(loc);
	}
	
	protected Vector3f createVector(String s) {
		String[] v = s.split(" ");
		assert(v.length == 3);
		float x = getFloat(v[0]);
		float y = getFloat(v[1]);
		float z = getFloat(v[2]);
		return new Vector3f(x, y, z);
	}
	
	protected float getFloat(String v) { return Float.valueOf(v).floatValue(); }
	
	public void setupCam(Camera cam) {
		cam.getLocation().set(location);
		cam.update();
	}
}